using ViScript.Core.Argument;

namespace ViScript.Core.Arguments
{
    public class NormalArguments : IArguments
    {
        private readonly IArgument[] arguments;

        public NormalArguments(params IArgument[] arguments)
        {
            this.arguments = arguments;
        }

        public bool IsValid
        {
            get
            {
                foreach (IArgument argument in arguments)
                {
                    if (!argument.IsValid)
                    {
                        return false;
                    }
                }
                return true;
            }
        }

        public IArgument[] Value
        {
            get { return arguments; }
        }

        public void Accept(IArgumentVisitor visitor)
        {
            foreach (IArgument argument in Value)
            {
                argument.Accept(visitor);
            }
        }
    }
}